﻿CREATE TRIGGER [tr_WorkFlow_Delete]
ON [dbo].[t_WorkFlow]
FOR DELETE
AS

IF EXISTS(SELECT * FROM t_MenuEvent me INNER JOIN deleted d ON d.MenuID = me.MenuFromID AND d.NextMenuID = me.MenuToID)BEGIN
	ROLLBACK TRAN
	RAISERROR('WorkFlow Path has an Event attached to it. Delete it first.',16,1)
	RETURN
END
